package com.company;

import java.util.Scanner;

/**
 * 编写程序，使用数组，保存10个随机整数，选出其中最大值
 */
public class demo10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int [] a= new int[10];
        for (int i=0;i<=a.length-1;i++){
            a[i] = (int) Math.ceil(Math.random()*100);
        }
        System.out.println("10个随机整数");
        for (int s :a){
            System.out.println(s+"");
        }
        System.out.println("");
        int max= a[0];
        for (int i=0;i<a.length;i++){
            if(max<a[i]){
                max=a[i];
            }
        }
        System.out.println("最大值为"+max);
    }
}
